import http from '@/util/request'
import {useUserStore} from '@/stores/user'

//获取大洲
export const getAllContinents = () => {
  return http.request({
    url: '/api/v1/buyer/geo/getAllContinents',
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

//获取大洲下的国家
export const getAllCountries = (continentId: number) => {
  return http.request({
    url: '/api/v1/buyer/geo/getAllCountries/'+continentId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

//获取国家下的州市
export const getAllStates = (countryId: number) => {
  return http.request({
    url: '/api/v1/buyer/geo/getAllStates/'+countryId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

//获取州市下的城市
export const getAllCities = (stateId: number) => {
  return http.request({
    url: '/api/v1/buyer/geo/getAllCities/'+stateId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

//获取城市下的地区
export const getAllRegions = (cityId: number) => {
  return http.request({
    url: '/api/v1/buyer/geo/getAllRegions/'+cityId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
